package Graph;

import java.util.List;

//顶点
public class Vertex {
    String name;
    List<Edge> edges; //边的集合 比如一个顶点有两条边

    //初始距离都是无穷大
    int dist = Integer.MAX_VALUE;
    int status; //拓扑排序 0 未访问 1访问中 2访问过
    int inDegree; //入度
    Boolean visited = false; //是否被访问过

    public Vertex(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static void main(String[] args) {
        Vertex a = new Vertex("a");
        Vertex b = new Vertex("b");
        Vertex c = new Vertex("c");
        Vertex d = new Vertex("d");

        a.edges = List.of(new Edge(b), new Edge(b));
        b.edges = List.of(new Edge(d));
        c.edges = List.of(new Edge(d));
        d.edges = List.of();


    }


}
